<HTML>
	<STYLE>v\:*{behavior:url(#default#VML);}</STYLE>
	<script>
/*var x0=100;
var y0=100;
var x1=210;
var y1=50;
var d=Math.sqrt((y1-y0)*(y1-y0)+(x1-x0)*(x1-x0));
var Xa = x1 + 10 * ((x0 - x1) + (y0 - y1) / 2) / d;
var Ya = y1 + 10 * ((y0 - y1) - (x0 - x1) / 2) / d; 
var Xb = x1 + 10 * ((x0 - x1) - (y0 - y1) / 2) / d; 
var Yb = y1 + 10 * ((y0 - y1) + (x0 - x1) / 2) / d; 


double D = Math.abs(Point2D.distance(X1, Y1, X0, Y0)); 
if (D > 0.0000000001 ){ 
Xa = X1 + ArrowLen * ((X0 - X1) + (Y0 - Y1) / 2) / D; 
Ya = Y1 + ArrowLen * ((Y0 - Y1) - (X0 - X1) / 2) / D; 
Xb = X1 + ArrowLen * ((X0 - X1) - (Y0 - Y1) / 2) / D; 
Yb = Y1 + ArrowLen * ((Y0 - Y1) + (X0 - X1) / 2) / D; 
} 

filledTrigon.moveTo((float)X1, (float)Y1); 
filledTrigon.lineTo((float)Xa, (float)Ya); 
filledTrigon.moveTo((float)X1, (float)Y1); 
filledTrigon.lineTo((float)Xb, (float)Yb); 
*/
function reDraw(){
poly1.points.value=x0+","+y0+","+x1+","+y1+","+Xa+","+Ya+","+x1+","+y1+","+Xb+","+Yb;
}

function drawArrow(x0,y0,x1,y1){
var d=Math.sqrt((y1-y0)*(y1-y0)+(x1-x0)*(x1-x0));
var Xa = x1 + 10 * ((x0 - x1) + (y0 - y1) / 2) / d;
var Ya = y1 + 10 * ((y0 - y1) - (x0 - x1) / 2) / d; 
var Xb = x1 + 10 * ((x0 - x1) - (y0 - y1) / 2) / d; 
var Yb = y1 + 10 * ((y0 - y1) + (x0 - x1) / 2) / d; 
var html="<v:polyline style='Z-INDEX:1;LEFT:0;POSITION:absolute;TOP:0' points='"+x0+","+y0+","+x1+","+y1+","+Xa+","+Ya+","+x1+","+y1+","+Xb+","+Yb+"' filled='f' />";
//pl.points.value=x0+","+y0+","+x1+","+y1+","+Xa+","+Ya+","+x1+","+y1+","+Xb+","+Yb;
container.innerHTML+=html;
}

</script>
<BODY bgcolor="#eeeeee">	
	<!--<v:polyline id="poly1" style="Z-INDEX:1;LEFT:0;POSITION:absolute;TOP:0" points="0,0,30,40" filled="f" />	-->
	<div id="container"></div>
	<button onclick="drawArrow(50,51,10,100)">redraw</button>
</BODY>
</HTML>
